//
//  UFONovelCollectionViewCell.m
//  unrivalledForUniverse
//
//  Created by dllo on 16/1/21.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "UFONovelCollectionViewCell.h"

@implementation UFONovelCollectionViewCell

- (void)dealloc
{
    [_titleImage release];
    [_signname release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    self.backgroundColor = [UIColor orangeColor];
    
    self.titleImage = [UIImageView new];
    self.titleImage.backgroundColor = [UIColor cyanColor];
    [self.contentView addSubview:self.titleImage];
    
    self.signname = [UILabel new];
    self.signname.backgroundColor = [UIColor colorWithWhite:0.888 alpha:0.360];
    self.signname.textAlignment = NSTextAlignmentCenter;
    self.signname.textColor = [UIColor blackColor];
    self.signname.numberOfLines = 0;
    [self.contentView addSubview:self.signname];
    
    
}

- (void)layoutSubviews
{
    
    [super layoutSubviews];
    [self.titleImage mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView).offset(10);
        make.left.equalTo(self.contentView.mas_left).offset(10);
        make.right.equalTo(self.contentView.mas_right).offset(-10);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-10);
    }];
    
    [self.signname mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.top.equalTo(self.contentView.mas_top).offset(20);
        make.right.equalTo(self.contentView.mas_right).offset(-20);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-20);
        make.width.mas_equalTo(@30);
    }];
}

@end
